Tracing the Evaluation of Lazy Functional Languages: A Model and its Implementation
نویسندگان
چکیده
We address the problem of producing a trace of the evaluation of a program written in a lazy functional language. To avoid ambiguities and possible misunderstandings it is essential that the trace structure is deened with respect to a formally described model of program evaluation. We provide such a formal semantics for lazy evaluation of a simple lazy language, based closely on the work of Launchbury. The trace corresponds to the sequence of expression reductions deened by the evaluation model. We also present a scheme to generate a concrete trace of the evaluation of programs written in the target language, based on its semantic rules. We employ a two-step transformational approach: rst transform the program so that, on execution, it generates a call-by-name trace as result, then further transform this trace to a call-by-need trace.
منابع مشابه
Cdmtcs Research Report Series Tracing Lazy Functional Languages Tracing Lazy Functional Languages
We argue that Ariola and Felleisen's and Maraist, Odersky and Wadler's axiomatization of the call-by-need lambda calculus forms a suitable formal basis for tracing evaluation in lazy functional languages. In particular, it allows a one-dimensional textual representation of terms, rather than requiring a two-dimensional graphical representation using arrows. We describe a program LetTrace, imple...
متن کاملTracing Lazy Functional Languages
We argue that Ariola and Felleisen's and Maraist, Odersky and Wadler's call-by-need lambda calculus forms a suitable formal basis for tracing evaluation in lazy functional languages. 1 Tracing functional languages One major advantage of pure, and especially lazy, functional languages over more conventional imperative languages is in not having to directly and completely specify the order of exe...
متن کاملHyperstrictness and the Parallel Evaluation of Lazy Functional Programs
Strictness analysis can be used for automatic parallelization of lazy functional programs while preserving their semantics (and termination properties, in particular). This paper considers ways of exploiting strictness analysis in implementing functional languages eeciently on stock parallel hardware. A strictness{based parallel evaluation model is presented, and is compared with the more gener...
متن کاملDynamic slicing of lazy functional programs based on redex trails
Tracing computations is a widely used methodology for program debugging. Lazy languages, however, pose new demands on tracing techniques because following the actual trace of a computation is generally useless. Typically, tracers for lazy languages rely on the construction of a redex trail, a graph that stores the reductions performed in a computation. While tracing provides a significant help ...
متن کاملTowards a Theory of Tracing for Functional Programs based on Graph Rewriting
The tracer Hat records in a detailed trace the computation of a program written in the lazy functional language Haskell. The trace can then be viewed in various ways to support program comprehension and debugging. Here we describe a model of the trace that captures its essential properties and allows formal reasoning. The trace structure was inspired by standard graph rewriting implementations ...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 1997